package com.example.photography.fragment.focus;

import android.widget.ListView;
import android.widget.TextView;

import com.example.photography.R;
import com.example.photography.adapter.focus.FansAdapter;
import com.example.photography.bean.FocusBean;
import com.example.photography.common.BaseFragment;
import com.example.photography.util.Util;
import com.loopj.android.http.RequestParams;

import java.util.List;

import butterknife.BindView;

public class Fans_fragment extends BaseFragment {
    @BindView(R.id.tv_nums)
    TextView tvNums;
    @BindView(R.id.lv_fans)
    ListView lvFans;
    private List<FocusBean.DataBean.FanssBean> fanssBeanList;

    public Fans_fragment(List<FocusBean.DataBean.FanssBean> fanssBeanList) {
        this.fanssBeanList = fanssBeanList;
    }

    @Override
    protected RequestParams getParams() {
        return null;
    }

    @Override
    protected String getUrl() {
        return null;
    }

    @Override
    protected void initData(String content) {
        tvNums.setText(fanssBeanList.size()+"人");
        FansAdapter fansAdapter = new FansAdapter(fanssBeanList, getActivity()) {
            @Override
            public void focus() {
                Util.showToast(getActivity(),"关注成功");
            }
        };
        lvFans.setAdapter(fansAdapter);

    }

    @Override
    public int getLayoutId() {
        return R.layout.frament_fans;
    }
}
